<?php


namespace Tbf\Bundle\UpyunBundle\Service;


use Tbf\Bundle\UpyunBundle\Model\UpYun;
use Tbf\Bundle\UpyunBundle\UpyunSaver;
use Tbf\Component\Path\PathFunction;

class UpyunSave {
    protected $upyun;
    protected $base_url;
    function __construct(UpYun $upyun,$base_url){
        $this->upyun = $upyun;
        $this->base_url = $base_url;
    }
    function newSaver($ref_path){
        return new UpyunSaver($this->upyun,$ref_path,PathFunction::urlJoin($this->base_url,$ref_path));
    }
}